home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mgr / lib / window.h < prev   
C/C++ Source or Header  |  1990-09-27  |  9KB  |  231 lines

  1. /*                        Copyright (c) 1988 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: window.h,v 4.2 88/08/12 07:41:26 sau Exp $
  9.     $Source: /tmp/mgrsrc/lib/RCS/window.h,v $
  10. */
  11. static char    h_window_[] = "$Source: /tmp/mgrsrc/lib/RCS/window.h,v $$Revision: 4.2 $";
  12.  
  13. /* defines for terminal emulator */
  14.  
  15. /* text flags - for commands with text string arguments */
  16.  
  17. #define T_INVALID    0    /* invalid command */
  18. #define T_FONT        1    /* down load a new font */
  19. #define T_MENU        2    /* down load a menu */
  20. #define T_EVENT        3    /* down load an event string */
  21. #define T_YANK        4    /* fill the yank bufffer */
  22. #define T_BITMAP    5    /* down load a bit map */
  23. #define T_COMMAND    6    /* start a new window & command in it */
  24. #define T_GIMME        7    /* send me stuff */
  25. #define T_SMAP        8    /* save a bitmap on a file */
  26. #define T_GMAP        9    /* read a bitmap from a file */
  27. #define T_SEND        10    /* send a message to another application */
  28. #define T_GRUNCH    11    /* fast-draw, short vector mode */
  29. #define T_STRING    12    /* write a text sting into an offscreen bitmap */
  30.  
  31. /* option codes for GETMODE / SETMODE  */
  32.  
  33. #define M_STANDOUT    0    /* window is in standout mode  */
  34. #define M_WOB        1    /* window is white on black  */
  35. #define M_AUTOEXPOSE    2    /* expose window upon shell output  */
  36. #define M_BACKGROUND    3    /* permit obscured window to update  */
  37. #define M_NOINPUT    4    /* don't accept keyboard input  */
  38. #define M_NOWRAP    5    /* don't auto wrap  */
  39. #define M_OVERSTRIKE    6    /* overstrike mode  */
  40. #define M_ABS        7    /* use absolute coordinates  */
  41. #define M_ACTIVATE    8    /* activate / hide window; not a mode */
  42. #define M_STACK        12    /* permit event stacking */
  43. #define M_DUPKEY    13    /* set keyboard escape key */
  44. #define M_NOBUCKEY    14    /* prevent mgr processing buckey keys,
  45.                    pass them through to the application */
  46.  
  47. /* cut/paste options */
  48.  
  49. #define M_SNARFLINES    9    /* only snarf entire lines */
  50. #define M_SNARFTABS    10    /* change spaces to tabs in snarf */
  51. #define M_SNARFHARD    11    /* snarf even if errors */
  52.  
  53. /* option codes for GETINFO */
  54.  
  55. #define G_MOUSE         0    /* mouse coordinates  */
  56. #define G_TERMCAP     1    /* send back termcap entry  */
  57. #define G_WINSIZE     2    /* cols, lines  */
  58. #define G_FONT         3    /* font wide, high, #  */
  59. #define G_COORDS     4    /* window coords  */
  60. #define G_STATUS     5    /* window status  */
  61. #define G_ALL         6    /* complete window status  */
  62. #define G_SYSTEM     7    /* system status  */
  63. #define G_ALLFONT     8    /* font information  */
  64. #define G_TEXT        9    /* text region size */
  65. #define G_ALLMINE      10    /* window status for client windows */
  66. #define G_CURSOR    11    /* character/ graphics cursor position */
  67. #define G_MOUSE2    12    /* cooked mouse coordinates  */
  68. #define G_NOTIFY    13    /* gimme info re notify windows */
  69. #define G_ID        14    /* my client window number */
  70. #define G_FLAGS        15    /* current window flags */
  71. #define G_MAX        15    /* maximum GETINFO value */
  72.  
  73. /* option codes for stacking window environment */
  74.  
  75. #define P_MENU        0x001    /* push menus */
  76. #define P_EVENT        0x002    /* push events */
  77. #define P_FONT        0x004    /* push current font */
  78. #define P_CURSOR    0x008    /* push current cursor position  */
  79. #define P_BITMAP    0x010    /* push saved bitmaps */
  80. #define P_POSITION    0x020    /* push window location */
  81. #define P_WINDOW    0x040    /* push window contents */
  82. #define P_FLAGS        0x080    /* push window flags */
  83. #define P_MOUSE        0x100    /* push mouse position */
  84. #define P_TEXT        0x200    /* push text region */
  85.  
  86.  
  87. #define P_ALL        0x3ff    /* push everything */
  88. #define P_MAX        0x400    /* end of codes marker */
  89. #define P_DEFAULT    (P_MENU | P_EVENT | P_FONT | P_FLAGS | P_TEXT)
  90. #define P_CLEAR        0x400    /* clear new environment */
  91.  
  92. /* menu_flags */
  93.  
  94. #define MF_SNIP        8    /* don't send action for parent of s/o menu */
  95. #define MF_PAGE        4    /* auto-page for menus */
  96. #define MF_AUTO        2    /* auto-right exit for menus */
  97. #define MF_CLEAR    1    /* clear menu flags */
  98.  
  99. /* Escape codes */
  100.  
  101. #define ESC        '\033'    /* escape character */
  102.  
  103. #define E_MINUS        '-'    /* set the munus flag */
  104. #define E_SEP1        ','    /* primary field seperator */
  105. #define E_SEP2        ';'    /* secondary field seperator */
  106. #define E_MOUSE        '?'    /* testing  -- move the mouse  */
  107. #define E_ADDLINE    'a'    /* add a new line  */
  108. #define E_ADDCHAR    'A'    /* add a character  */
  109. #define E_BITBLT    'b'    /* do a bit blit  */
  110. #define E_BITCRT    'B'    /* create a bit blit  */
  111. #define E_CLEAREOL    'c'    /* clear  */
  112. #define E_CLEAREOS    'C'    /* clear  */
  113. #define E_DELETELINE    'd'    /* delete a line */
  114. #define E_BITLOAD    'D'    /* download a bitmap  */
  115. #define E_EVENT        'e'    /* download events  */
  116. #define E_DELETECHAR    'E'    /* delete a char */
  117. #define E_DOWN        'f'    /* down 1 line */
  118. #define E_FONT        'F'    /* pick a new font  */
  119. #define E_GO        'g'    /* Go; move graphics pointer  */
  120. #define E_MOVE        'G'    /* move to x,y pixels  */
  121. #define E_SETCURSOR    'h'    /* select cursor style */
  122. #define E_BLEEP        'H'    /* blink a section of the screen */
  123. #define E_GETINFO    'I'    /* get info from mgr */
  124. #define E_STANDOUT    'i'    /* start standout mode */
  125. #define E_FCOLOR    'j'    /* set forground color */
  126. #define E_BCOLOR    'J'    /* set background color */
  127. #define E_LINE        'l'    /* Plot a line  */
  128. #define E_LINK        'L'    /* menu links */
  129. #define E_MENU        'm'    /* download menus */
  130. #define E_CUP        'M'    /* move to col, row (zero origin)  */
  131. #define E_STANDEND    'n'    /* end standout mode */
  132. #define E_CIRCLE    'o'    /* Plot a circle or an ellipse or an arc */
  133. #define E_PUSH        'P'    /* push window environment */
  134. #define E_POP        'p'    /* pop window environment */
  135. #define E_RUBBER    'R'    /* rubber band a line/rect (obsolete) */
  136. #define E_RIGHT        'r'    /* right 1 column  */
  137. #define E_CLEARMODE    's'    /* clear window mode */
  138. #define E_SETMODE    'S'    /* set a window mode */
  139. #define E_TEXTREGION    't'    /* set the text region */
  140. #define E_UPLINE    'u'    /* up 1 line  */
  141. #ifdef atarist
  142. #define E_UP        E_UPLINE  /* Some programs expect E_UP still?? */
  143. #endif
  144. #define E_BITGET    'U'    /* upload a bitmap  */
  145. #define E_SHAPE        'W'    /* reshape window, make it active  */
  146. #define E_SIZE        'w'    /* reshape window: cols,rows  */
  147. #define E_GIMME        'x'    /* send me data */
  148. #define E_PUTSNARF    'y'    /* put the snarf buffer  */
  149. #define E_SNARF        'Y'    /* snarf text into the snarf buffer  */
  150. #define E_VI        'V'    /* set vi mode */
  151. #define E_NOVI        'v'    /* turn off vi mode */
  152. #define E_HALFWIN    'z'    /* make a 1/2 window */
  153. #define E_MAKEWIN    'Z'    /* make/goto a new window */
  154. #define E_NULL        '$'    /* do nothing, force exit */
  155. #define E_SMAP        '>'    /* save a bitmap */
  156. #define E_GMAP        '<'    /* get a bitmap */
  157. #define E_SEND        '|'    /* send a message to another application */
  158. #define E_CURSOR    '%'    /* set mouse cursor */
  159. #define E_GRUNCH    ':'    /* graphics crunch mode (experimental) */
  160. #define E_STRING    '.'    /* write characters in offscreen bitmap */
  161. #ifdef XMENU
  162. #define E_XMENU        'X'    /* extended menu operations */
  163. #endif
  164.  
  165.  
  166. /* misc */
  167.  
  168. #define C_NOCHAR    '?'    /* for character not in font */
  169. #define C_EXPOSED    'e'    /* window is not obscured */
  170. #define C_ACTIVE    'a'    /* window has input focus */
  171. #define C_NOTACTIVE    'n'    /* window is obscured */
  172. #define C_OBSCURED    'o'    /* window is obscured */
  173. #define C_NAME        "px|mgr|mgr teminal emulator"
  174.  
  175. #define C_NULL        '\000'    /* null */
  176. #define C_BS        '\b'    /* back space */
  177. #define C_FF        '\f'    /* form feed */
  178. #define C_BELL        '\007'    /* bell */
  179. #define C_TAB        '\t'    /* tab */
  180. #define C_RETURN    '\r'    /* return */
  181. #define C_NL        '\n'    /* line feed */
  182.  
  183. /* cursor styles */
  184. #define CS_BLOCK        0        /* standard block cursor */
  185. #define CS_LEFT        1        /* left vertical bar */
  186. #define CS_RIGHT        2        /* right vertical bar */
  187. #define CS_BOX            3        /* outline */
  188. #define CS_UNDER        4        /* underline */
  189. #define CS_INVIS        9        /* invisible */
  190.  
  191. /* some raster op functions  (for bit_copy) */
  192.  
  193. #ifndef BIT_NOT
  194. #define BIT_NOT(x)    (~(x))        /* from bitmap.h */
  195. #endif
  196. #define B_SRC        (0xc)
  197. #define B_DST        (0xa)
  198. #define B_OR        (B_SRC|B_DST)
  199. #define B_COPY        (B_SRC)
  200. #define B_COPYINVERTED    ((BIT_NOT(B_SRC))&0xf)
  201. #define B_XOR        (B_SRC^B_DST)
  202. #define B_AND        (B_SRC&B_DST)
  203.  
  204. /* raster op functions  (for bit_write and bit_line) */
  205.  
  206. #define B_SET        (0xf)
  207. #define B_CLEAR        (0x0)
  208. #define B_INVERT    ((BIT_NOT(B_DST))&0xf)
  209.  
  210. /* where to find icon directory */
  211.  
  212. #ifndef ICONDIR
  213. #  define ICONDIR        "/usr/mgr/icon"    /* readable by all icons */
  214. #endif
  215.  
  216. /* other macros */
  217.  
  218. #define Scalex(x) \
  219.     (W(flags)&W_ABSCOORDS ?  (x) :  (x) * (int)BIT_WIDE(W(window))/GMAX)
  220. #define Scaley(y) \
  221.     (W(flags)&W_ABSCOORDS ?  (y) :  (y) * (int)BIT_HIGH(W(window))/GMAX)
  222. #define Scalexy(y) \
  223.     (W(flags)&W_ABSCOORDS ?  (y) : \
  224.      (y) * (int)(BIT_HIGH(W(window))+BIT_WIDE(W(window)))/(2*GMAX))
  225.  
  226. #define FSIZE(c)    ((int) (W(font)->head.c))
  227. #define WIDE            BIT_WIDE(window)
  228. #define HIGH            BIT_HIGH(window)
  229. #define T_WIDE            BIT_WIDE(text)
  230. #define T_HIGH            BIT_HIGH(text)
  231.